package com.enzoism.spring.controller;

import com.enzoism.spring.bean.UserModel;
import com.enzoism.spring.common.http.Result;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wenrui.springboot.util.common.http.ResultGenerator;

/**
 * @program: SpringCloud
 * @description: 模拟用户的接口
 * @author: zhifeng
 * @create: 2020-12-07 08:36
 */
@RestController
@RequestMapping("user")
public class UserController {

    @RequestMapping("/userList")
    public Result getUserList() {

        return ResultGenerator.genSuccessResult(UserModel.getUserList());
    }

    @RequestMapping("/user/{id}")
    public Result getUser(@PathVariable(value = "id") String id) {

        return ResultGenerator.genSuccessResult(UserModel.getUserById(id));
    }

}
